/**
 * @intro: haoguosheng
 * @Date: 2019-05-10 15:51:16
 */
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link, Switch, Redirect } from 'react-router-dom'

//  页面
import ProductList from './index/index'
import ProductSave from './index/save'
import ProductDetail from './index/detail'
import CategoryList from './category/index'
import CategoryAdd from './category/add'

class ProductRouter extends Component {
	constructor(props) {
		super(props);
		this.state = {  };
	}
	render() {
		return (
			<Switch>
				<Route path="/product/index" component={ProductList} />
				<Route path="/product/save/:pid?" component={ProductSave} />
				<Route path="/product/detail/:pid" component={ProductDetail} />
				<Route path="/product-category/add" component={CategoryAdd} />
				<Route path="/product-category/index/:categoryId?" component={CategoryList} />
				{/* <Route path="/product/save" component={ProductSave} /> */}
				<Redirect exact from="/product" to="/product/index" />
				<Redirect exact from="/product-category" to="/product-category/index" />
			</Switch>
		);
	}
}

export default ProductRouter;
